<?php
namespace app\custom\model;

use app\common\library\Model;

class CustomFee extends Model
{
    protected $append = [
        'type_text'
    ];

    public function getTypeTextAttr($value, $data) {
        $arr = ['recharge' => '充值', 'deduction' => '消费'];
        if (isset($data['type'])) {
            return $arr[$data['type']];
        }
        return '-';
    }

    //获取客户信息
    public function custom() {
        return $this->hasOne('app\\custom\\model\\Custom','current_id', 'current_id');
    }

}
